home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
cool
/
ge_cool.lha
/
GE_COOL2.1
/
misc
/
defs
/
misc.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-23
|
3KB
|
112 lines
//
//
// Copyright (C) 1991 Texas Instruments Incorporated.
//
// Permission is granted to any individual or institution to use, copy, modify,
// and distribute this software, provided that this complete copyright and
// permission notice is maintained, intact, in all copies and supporting
// documentation.
//
// Texas Instruments Incorporated provides this software "as is" without
// express or implied warranty.
//
// This file contains useful definitions, macros, and constants used through
// out most header and source files.
//
#ifndef MISCELANEOUSH // If no miscelaneous header
#define MISCELANEOUSH
#include <values.h> // platform specific constants
#ifndef DEFSH
#include <defs.h> // Include the defs header
#endif
/*
#if (defined(MSDOS) && !defined(DOS)) // For IBM or MS compilers
#define DOS
#endif
*/
#ifndef INVALID // Define INVALID for curpos
#define INVALID (-1)
#endif
#ifndef END_OF_STRING // If END_OF_STRING not defined
#define END_OF_STRING (0)
#endif
#ifndef NEWLINE // If Newline char not defined
#define NEWLINE '\n'
#endif
#ifndef SENSITIVE // If case flags not defined
#define SENSITIVE TRUE
#define INSENSITIVE FALSE
#endif
#ifndef MINSHORT
#define MINSHORT ((short)(1 << BITS(short) - 1))
#endif
#ifndef MININT
#define MININT (1 << BITS(int) - 1)
#endif
#ifndef MINLONG
#define MINLONG (1L << BITS(long) - 1)
#endif
#ifndef NUMBER_STATES
#define NUMBER_STATES
enum N_status { N_OK, N_MINUS_INFINITY, N_PLUS_INFINITY, N_OVERFLOW,
N_UNDERFLOW, N_NO_CONVERSION, N_DIVIDE_BY_ZERO };
#endif
/*
In values.h
#define MAXDOUBLE 1.79769313486231470e+308
#define MAXFLOAT ((float)3.40282346638528860e+38)
#define MINDOUBLE 4.94065645841246544e-324
#define MINFLOAT ((float)1.40129846432481707e-45)
*/
#define _IEEE 1
#define _DEXPLEN 11
#define _HIDDENBIT 1
#define DMINEXP (-(DMAXEXP + DSIGNIF - _HIDDENBIT - 3))
#define FMINEXP (-(FMAXEXP + FSIGNIF - _HIDDENBIT - 3))
#ifndef ABS
#define ABS(x) ((x >= 0) ? (x) : (-x))
#endif
// even -- Determine if long integer is odd of even
// Input: long integer
// Output: Boolean TRUE/FALSE
inline Boolean even (long n) {
return ((n & 1) ? FALSE : TRUE);
}
// odd -- Determine if long integer is odd of even
// Input: long integer
// Output: Boolean TRUE/FALSE
inline Boolean odd (long n) {
return ((n & 1) ? TRUE : FALSE);
}
// The "#pragma defmacro" is a COOL extension to the standard ANSI C processor
// that allows a programmer to define macro extensions to the language. All
// COOL macros have been incorporated into the preprocessor itself to
// facilitate extra speed and efficiency. User defined extensions are searched
// for on the include file path.
#pragma defmacro MACRO "macro" delimiter=} recursive
#pragma defmacro template "template" delimiter=}
#pragma defmacro DECLARE "declare" delimiter=> recursive lines
#pragma defmacro IMPLEMENT "implement" delimiter=> recursive lines
#endif MISCELANEOUSH // End #ifdef